package com.ruoyi.sale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SaleDeliveryItemMapper;
import com.ruoyi.sale.domain.SaleDeliveryItem;
import com.ruoyi.sale.service.ISaleDeliveryItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售订单发货明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class SaleDeliveryItemServiceImpl implements ISaleDeliveryItemService 
{
    @Autowired
    private SaleDeliveryItemMapper saleDeliveryItemMapper;

    /**
     * 查询销售订单发货明细
     * 
     * @param deliveryItemId 销售订单发货明细主键
     * @return 销售订单发货明细
     */
    @Override
    public SaleDeliveryItem selectSaleDeliveryItemByDeliveryItemId(Long deliveryItemId)
    {
        return saleDeliveryItemMapper.selectSaleDeliveryItemByDeliveryItemId(deliveryItemId);
    }

    /**
     * 查询销售订单发货明细列表
     * 
     * @param saleDeliveryItem 销售订单发货明细
     * @return 销售订单发货明细
     */
    @Override
    public List<SaleDeliveryItem> selectSaleDeliveryItemList(SaleDeliveryItem saleDeliveryItem)
    {
        return saleDeliveryItemMapper.selectSaleDeliveryItemList(saleDeliveryItem);
    }

    /**
     * 新增销售订单发货明细
     * 
     * @param saleDeliveryItem 销售订单发货明细
     * @return 结果
     */
    @Override
    public int insertSaleDeliveryItem(SaleDeliveryItem saleDeliveryItem)
    {
        return saleDeliveryItemMapper.insertSaleDeliveryItem(saleDeliveryItem);
    }

    /**
     * 修改销售订单发货明细
     * 
     * @param saleDeliveryItem 销售订单发货明细
     * @return 结果
     */
    @Override
    public int updateSaleDeliveryItem(SaleDeliveryItem saleDeliveryItem)
    {
        return saleDeliveryItemMapper.updateSaleDeliveryItem(saleDeliveryItem);
    }

    /**
     * 批量删除销售订单发货明细
     * 
     * @param deliveryItemIds 需要删除的销售订单发货明细主键
     * @return 结果
     */
    @Override
    public int deleteSaleDeliveryItemByDeliveryItemIds(String deliveryItemIds)
    {
        return saleDeliveryItemMapper.deleteSaleDeliveryItemByDeliveryItemIds(Convert.toStrArray(deliveryItemIds));
    }

    /**
     * 删除销售订单发货明细信息
     * 
     * @param deliveryItemId 销售订单发货明细主键
     * @return 结果
     */
    @Override
    public int deleteSaleDeliveryItemByDeliveryItemId(Long deliveryItemId)
    {
        return saleDeliveryItemMapper.deleteSaleDeliveryItemByDeliveryItemId(deliveryItemId);
    }
}
